<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sorting Algorithm Visualizer</title>
    <link rel="stylesheet" href="css/styles.css">
</head>
<body>
    <div class="container">
        <header>
            <h1>Sorting Algorithm Visualizer</h1>
            <p>Interactive visualization of sorting algorithms</p>
        </header>

        <div class="controls">
            <div class="control-group">
                <label for="algorithm">Algorithm:</label>
                <select id="algorithm">
                    <option value="bubble">Bubble Sort</option>
                    <option value="selection">Selection Sort</option>
                    <option value="insertion">Insertion Sort</option>
                    <option value="merge">Merge Sort</option>
                    <option value="quick">Quick Sort</option>
                    <option value="heap">Heap Sort</option>
                    <option value="shell">Shell Sort</option>
                    <option value="counting">Counting Sort</option>
                    <option value="radix">Radix Sort</option>
                </select>
            </div>

            <div class="control-group">
                <label for="array-size">Array Size:</label>
                <input type="range" id="array-size" min="10" max="100" value="50">
                <span id="size-value">50</span>
            </div>

            <div class="control-group">
                <label for="speed">Speed:</label>
                <input type="range" id="speed" min="1" max="10" value="5">
                <span id="speed-value">5x</span>
            </div>

            <div class="control-group">
                <button id="generate-array">Generate New Array</button>
                <button id="start-sort">Start Sorting</button>
                <button id="stop-sort" disabled>Stop</button>
                <button id="record-gif">Record GIF</button>
                <button id="download-gif" disabled>Download GIF</button>
            </div>
        </div>

        <div class="visualization-container">
            <canvas id="canvas" width="800" height="400"></canvas>
        </div>

        <div class="stats">
            <div class="stat-item">
                <span class="stat-label">Comparisons:</span>
                <span id="comparisons">0</span>
            </div>
            <div class="stat-item">
                <span class="stat-label">Swaps:</span>
                <span id="swaps">0</span>
            </div>
            <div class="stat-item">
                <span class="stat-label">Time:</span>
                <span id="time">0ms</span>
            </div>
        </div>
    </div>

    <script type="module" src="js/main.js"></script>
</body>
</html>